package com.atguigu.hellomp;

import com.atguigu.hellomp.entity.User;
import com.atguigu.hellomp.mapper.UserMapper;
import com.atguigu.hellomp.service.api.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * @author 张智勇
 * @date 2025年08月13日 20:04
 */


@SpringBootTest
public class test2 {

    @Autowired
    UserMapper userMapper;

    @Autowired
    UserService userService;
    @Test
    public void test1(){
        User user = userMapper.selectById(1L);
        System.out.println("user = " + user);
    }
    @Test
    public void testSelectList() {
        List<User> users = userMapper.selectList(null);
        users.forEach(System.out::println);
        users.forEach(System.out::println);
//        System.out.println("users = " + users);
    }

    @Test
    public void test2(){
        List<User> users = userService.getMyusers();
        users.forEach(System.out::println);
    }

}
